const initialState = {
    list: [],
};

export const actionsTypes = {
    GET_CAT_LIST: "GET_CAT_LIST",
    RESPONSE_CAT_LIST: "RESPONSE_CAT_LIST",
};

export const actions = {
    get_cat_list: function () {
        return {
            type: actionsTypes.GET_CAT_LIST
        }
    },
}

export function reducer(state=initialState, action) {
    switch (action.type) {
        case actionsTypes.RESPONSE_CAT_LIST:
            return {
                ...state,
                list: action.data.data
            }   
        default:
            return state
    }
}